#
#  Makefile for creation of the program named by the PROG variable
#
#  The following naming conventions are used by this makefile:
#	<prog>.asm	- C54 assembly language source file
#	<prog>.obj	- C54 object file (compiled/assembled source)
#	<prog>.out	- C54 executable (fully linked program)
#	<prog>cfg.s54	- configuration assembly source file generated
#			  by Configuration Tool
#	<prog>cfg.h54	- configuration assembly header file generated
#			  by Configuration Tool
#	<prog>cfg.cmd	- configuration linker command file generated
#			  by Configuration Tool
#

#TI_DIR  := $(subst \,/,$(TI_DIR))
include $(TI_DIR)/c5400/bios/include/c54rules.mak

#
#  Compiler, assembler, and linker options.
#
# -g enable symbolic debugging
# -i Need to specify include dir since A_DIR is broken
CC54OPTS = -g -mf -v548 -i.
AS54OPTS = -d_DSK5416_ -i$(TI_DIR)\c5400\bios\include -mf -v548
# -q quiet run
LD54OPTS = -c -q -x -i$(TI_DIR)\c5400\dsk5416\lib -ldsk5416f.lib # -q quiet run

TCONFOPTS = -Dconfig.importPath="%TI_DIR%\c5400\dsk5416\include" -Dconfig.tiRoot="%TI_DIR%"
#  Every BIOS program must be linked with:
#	$(PROG)cfg.o54	- object resulting from assembling $(PROG)cfg.s54
#	$(PROG)cfg.cmd	- linker command file generated by Config Tool. If
#			  additional liner command files exist, $(PROG)cfg.cmd
#			  must appear first.
#
PROG	= audio
OBJS    = $(PROG)cfg.obj $(PROG)cfg_c.obj plio.obj
LIBS    = $(TI_DIR)\c5400\dsk5416\lib\dsk5416f.lib
CMDS    = $(PROG).cmd

#
#  Targets:
#
all:: $(PROG).out

$(PROG).out: $(OBJS) $(CMDS) $(PROG).cdb
#$(PROG)cfg.obj: $(PROG)cfg.h54
#$(PROG).obj:

    
.clean clean::
	@ echo removing generated configuration files ...
	@$(REMOVE) -f $(PROG)cfg.s54 $(PROG)cfg.h54 $(PROG)cfg.cmd
	@ echo removing object files and binaries ...
	@$(REMOVE) -f *.obj *.out *.lst *.map

